<template>
	<div id="discovery" class="discovery">

		<grid class="discoveryGrid" :show-lr-borders="false" :show-vertical-dividers="false">
			<grid-item label="课表信息" @on-item-click="onClick('lessonTable')">
				<img slot="icon" src="../../assets/svg/icon_lesson.svg">
			</grid-item>
			<grid-item label="课消排名" @on-item-click="onClick('teacherLessonRank')">
				<img slot="icon" src="../../assets/svg/icon_lessonRank.svg">
			</grid-item>
			<grid-item label="试听学员" @on-item-click="onClick('poMemberStatusList')">
				<img slot="icon" src="../../assets/svg/icon_opportunity.svg">
			</grid-item>
			<grid-item label="市场名单" @on-item-click="onClick('marketingList')">
				<img slot="icon" src="../../assets/svg/icon_marketinglist.svg">
			</grid-item>
			<grid-item label="会员" @on-item-click="onClick('memberStatus')">
				<img slot="icon" src="../../assets/svg/icon_members.svg">
			</grid-item>
		</grid>

		<PendingActivityDiscovery></PendingActivityDiscovery>

		<RenewContractDiscovery></RenewContractDiscovery>

		<DiscoveryBarChart chartTitle="校区试听" url="ai/getDemoClassStatusByMonth" barColor="orangered"></DiscoveryBarChart>

		<DiscoveryBarChart chartTitle="课消情况" url="ai/getClassCompleteStatus" barColor="purple"></DiscoveryBarChart>

		<DiscoveryBarChart chartTitle="市场采单" url="ai/getMarketingStatusByMonth"></DiscoveryBarChart>

	</div>
</template>

<script>
	import bus from '@/event/eventBus'
	import DiscoveryBarChart from './discoveryBarChart'
	import PendingActivityDiscovery from './pendingActivityDiscovery'
	import RenewContractDiscovery from './renewContractDiscovery'
	import {Cell, Group, Grid, GridItem, VChart, VBar, VTooltip, XButton} from 'vux'
	export default {
		name: "sys-manage",
		components: {
			Cell,
			Group,
			Grid,
			GridItem,
			VChart,
			VBar,
			VTooltip,
			XButton,
			DiscoveryBarChart,
			RenewContractDiscovery,
			PendingActivityDiscovery
		},
		data() {
			return {
				lessonTable: '课表信息',
				lessonRank: '课消排名',
				poStudentStatus: '校区试听',
				marketingList: '市场待分配名单'
			}
		},
		created: function() {
			bus.$emit("userDefinedEvent", 2)
			bus.$emit("barController", 0)
		},
		methods: {
			onClick: function(value) {
				switch(value){
					case 'lessonTable':
						this.$router.push('lessonTable')
						break
					case 'teacherLessonRank':
						this.$router.push('teacherLessonRank')
						break
					case 'poMemberStatusList':
						this.$router.push('poMemberStatusList')
						break
					case 'marketingList':
						this.$router.push('marketingList')
						break
					case 'memberStatus':
						this.$router.push('memberStatus')
						break
					default:
						break
				}
			}
		}
	}
</script>

<style lang="less">
	@import '../../../../../node_modules/vux/src/styles/1px.less';

	.discoveryGrid {
		background-color: white;
	}

	.discoveryGrid > .weui-grid{
		text-decoration: none;
	}

	.discoveryGrid > .weui-grid > .weui-grid__label{
		font-size: 11px;
	}

	.card-demo-flex {
		display: flex;
	}
	.card-demo-content01 {
		padding: 10px 0;
	}
	.card-padding {
		padding: 15px;
	}
	.card-demo-flex > div {
		flex: 1;
		text-align: center;
		font-size: 12px;
	}
	.card-demo-flex span {
		color: #f74c31;
	}

	.discovery{
		background: #8080800d;
		margin-top: 46px;
		margin-bottom: 100px;
	}

	.discoveryCell{
		padding: 0 0 !important;
	}

	.discovery_icon {
		width: 20px;
		display: block;
		margin-right: 25px;
		margin-left: 10px;
	}

	.discoveryCellGroup {
		border-radius: 0px !important;
	}

</style>
